<template>
    <view class="list-scope">
        <view :class="['item', grid]">
            <coupon-item
                @__l="__l($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                @tap.native="__e($event, { eventOpts: [['^tap', [['clickItem']]]] })"
                :coupon="item"
                :data-event-opts="[['^tap', [['clickItem']]]]"
                :vueId="'81a4bf7c-1-' + index"
                v-for="(item, index) in list"
                :key="index"
            ></coupon-item>
        </view>
        <button @tap="__e" class="button button-fresh bg-purple" :data-event-opts="[['tap', [['initData', ['$event']]]]]" v-if="!isInit">点击获取优惠券</button>
    </view>
</template>

<script>
import couponItem from '@/components/CouponList/components/CouponItem';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['components/CouponList/CouponList'],
    {
        '040b': function (t, n, o) {
            'use strict';

            o.r(n);
            var e = o('986c');
            var i = o('5ca1');
            for (var u in i) {
                if (['default'].indexOf(u) < 0) {
                    (function (t) {
                        o.d(n, t, function () {
                            return i[t];
                        });
                    })(u);
                }
            }
            o('6a09');
            var c = o('f0c5');
            var s = Object(c.a)(i.default, e.b, e.c, false, null, null, null, false, e.a, void 0);
            n.default = s.exports;
        },
        '0768': function (t, n, o) {},
        '5ca1': function (t, n, o) {
            'use strict';

            o.r(n);
            var e = o('e233');
            var i = o.n(e);
            for (var u in e) {
                if (['default'].indexOf(u) < 0) {
                    (function (t) {
                        o.d(n, t, function () {
                            return e[t];
                        });
                    })(u);
                }
            }
            n.default = i.a;
        },
        '6a09': function (t, n, o) {
            'use strict';

            var e = o('0768');
            o.n(e).a;
        },
        '986c': function (t, n, o) {
            'use strict';

            o.d(n, 'b', function () {
                return e;
            });
            o.d(n, 'c', function () {
                return i;
            });
            o.d(n, 'a', function () {});
            var e = function () {
                this.$createElement;
                this._self._c;
            };
            var i = [];
        },
        e233: function (t, n, o) {
            'use strict';

            Object.defineProperty(n, '__esModule', {
                value: true
            });
            n.default = void 0;
            var e = {
                props: {
                    ids: {
                        type: Array
                    },
                    module: {
                        type: Object,
                        default: function () {
                            return {};
                        }
                    },
                    refreshCounter: Number
                },
                components: {
                    CouponItem: function () {
                        o.e('components/CouponList/components/CouponItem')
                            .then(
                                function () {
                                    return resolve(o('60a7'));
                                }.bind(null, o)
                            )
                            .catch(o.oe);
                    }
                },
                data: function () {
                    return {
                        list: [],
                        isInit: false
                    };
                },
                mounted: function () {
                    this.initData();
                },
                computed: {
                    isScroll: function () {
                        return 'scroll' == this.module.display;
                    },
                    grid: function () {
                        return this.module.grid || 'grid1';
                    }
                },
                watch: {
                    ids: function () {
                        this.initData();
                    },
                    refreshCounter: function () {
                        this.initData();
                    }
                },
                methods: {
                    initData: function () {
                        var that = this;
                        if (this.ids && this.ids.length > 0) {
                            this.$http('/coupons', 'GET', {
                                per_page: 100,
                                ids: this.ids
                            }).then(function (n) {
                                that.list = n.data.list;
                                that.isInit = true;
                            });
                        }
                    },
                    clickItem: function () {
                        this.$playAudio('click');
                    }
                }
            };
            n.default = e;
        }
    }
]);
(global.webpackJsonp = global.webpackJsonp || []).push([
    'components/CouponList/CouponList-create-component',
    {
        'components/CouponList/CouponList-create-component': function (t, n, o) {
            o('543d').createComponent(o('040b'));
        }
    },
    [['components/CouponList/CouponList-create-component']]
]);
</script>
<style>
@import './CouponList.css';
</style>
